package com.shun.oss.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 阿里云OSS的配置文件
 * @author clever
 * @since 2021-10-16
 */
@Configuration
public class OSSConfig {

    /**
     * oss管理bean配置名称
     */
    public static final String OSS_MGR = "ossMgr";

    /**
     * oss客户bean配置名称
     */
    public static final String OSS_CST = "ossCst";

    /**
     * 读写操作配置
     * @return
     */
    @Bean(OSSConfig.OSS_MGR)
    @ConfigurationProperties("shun.oss.mgr")
    public OSSConfigProperties getMgr(){
        return new OSSConfigProperties();
    }

    /**
     * 读操作配置
     * @return
     */
    @Bean(OSSConfig.OSS_CST)
    @ConfigurationProperties("shun.oss.cst")
    public OSSConfigProperties getCst(){
        return new OSSConfigProperties();
    }
}
